package com.ctshk.sapp.scenic.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.rpc.scenic.dto.ScenicResourceDTO;
import com.ctshk.rpc.scenic.req.AirshowApiSettingReq;
import com.ctshk.rpc.scenic.req.ScenicProductModifyRecommendStatusReq;
import com.ctshk.rpc.scenic.req.ScenicResourceReq;
import com.ctshk.rpc.scenic.service.IAirshowApiSettingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.ctshk.common.web.support.BaseController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-06-10
 */
@Api(value="航展产品中心服务", tags="航展产品中心服务")
@RestController
@RequestMapping("/airshow-api-setting")
public class AirshowApiSettingController extends BaseController {

    @DubboReference
    private IAirshowApiSettingService iAirshowApiSettingService;

    @ApiOperation(value = "获取产品API设置", notes = "获取产品API设置")
    @GetMapping(value = "/get-api-setting")
    public Result getApiSetting() {
        return iAirshowApiSettingService.getApiSetting();
    }

    @ApiOperation(value="修改航展API设置", notes="修改航展API设置")
    @OperationLogAnnotation(operModul = OperationLogModel.TICKET, operType = OperationLogType.UPDATE, operTitle = "修改珠海航展API设置", operDesc = "更改API设置相关内容")
    @PostMapping("/save-api-setting")
    public Result saveApiSetting(@RequestBody AirshowApiSettingReq airshowApiSettingReq){
        return iAirshowApiSettingService.saveApiSetting(airshowApiSettingReq,getCurrentUser(getRequest()));
    }

}
